#pragma once


typedef struct BiTnode{
	int data;
	struct BiTnode* lchild, *rchild;
}BiTnode, *BiTree;

typedef struct Stack{
	BiTnode* data[50];
	int top;
}Stack;

void Init(Stack* s)
{
	s->top = -1;
}

void Push(Stack* s,BiTnode* node)
{
	s->data[++s->top] = node;
}

void Pop(Stack* s)
{
	--s->top;
}

BiTnode* GetTop(Stack* s)
{
	return s->data[s->top];
}

bool IsEmpty_S(Stack* s)
{
	return s->top == -1;
}

typedef struct {
	BiTnode* data[50];
	int front, rear;
}Queue;

void Init_Queue(Queue* q)
{
	q->front = q->rear =-1;
}

bool IsEmpty_Q(Queue* q)
{
	return q->front == q->rear;
}

void EnOrder(Queue* q,BiTnode* t)
{
	q->data[++q->rear] = t;
}

void DeOrder(Queue* q,BiTnode** p)
{
	*p = q->data[++q->front];
}


